<?php $toolbarList = array(
	array('uri' => 'javascript:void(0);', 'title' => $this->lang->line('save'), 'class' => 'ico-save'),
	array('uri' => $link_back, 'title' => $this->lang->line('cancel'), 'class' => 'ico-cancel'),
)?>
<?php require_once 'commons/toolbar.php';?>
<div class="success"><?=$message;?></div>
<div class="fail"><?=$error;?></div>
<form id="frmEditAddData" accept-charset="utf-8" method="post" action="<?=$action;?>"  enctype="multipart/form-data" >
<div class="data">
<table class="wrapper">
	<tr>
		<td width="20%"><?=$this->lang->line('id');?></td>
		<td><input type="text" name="id" disabled class="short_text" value="<?php echo $this->validation->id; ?>"/>
		<input type="hidden" name="id" value="<?php echo $this->validation->id; ?>" /></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('title');?><span class="required"> *</span></td>
		<td><input type="text" name="title" class="long_text" value="<?=purify($this->validation->title);?>"/>
		<?php echo $this->validation->title_error; ?></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('summary');?><span class="required"> *</span></td>
		<td><textarea id="summaryEditor" rows="7" cols="70" name="summary"><?php echo $this->validation->summary; ?></textarea>
		<?php echo $this->validation->summary_error; ?></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('image-thumb');?></td>
		<td><input type="file" id="image_thumb" name="image_thumb" class="long_text" value="<?php echo $this->validation->image_thumb;?>"/>
		<?php echo $this->validation->image_thumb_error; ?></td>
	</tr>
	<tr>
		<td valign="top">&nbsp;</td>
		<td><img src="<?php echo base_url().UPLOAD_PATH.'thumb/'.$this->validation->image_thumb?>"/></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('image');?></td>
		<td><input type="file" id="image" name="image" class="long_text" value="<?php echo $this->validation->image;?>"/>
		<?php echo $this->validation->image_error; ?></td>
	</tr>
	<tr>
		<td valign="top">&nbsp;</td>
		<td><img src="<?php echo base_url().UPLOAD_PATH.'thumb/'.$this->validation->image?>"/></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('image-description');?></td>
		<td><input type="text" name="image_description" class="long_text" value="<?=purify($this->validation->image_description);?>"/>
		<?php echo $this->validation->image_description_error; ?></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('body');?><span class="required"> *</span></td>
		<td><textarea id="contentEditor" rows="7" cols="70" name="body"><?php echo $this->validation->body; ?></textarea>
		<?php echo $this->validation->body_error; ?></td>
	</tr>
	<tr>
		<td valign="top"><?=$this->lang->line('tag');?><span class="required"> *</span></td>
		<td>
			<select id="tag" name="tag" class="medium_text" >
				<?php foreach ($categories as $category) { ?>
					<option value="<?=$category->id ?>" <?=$this->validation->set_select('tag', $category->id);?> ><?=$category->name ?></option>
				<?php  } ?>
			</select>
		</td>
	</tr>
</table>
</div>
</form>